/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86156
 * Date: 2023-04-09
 * Time: 10:16
 */

// 字符串截取  string.substring();
public class Test2 {
    public static void main(String[] args) {
        String str = "15642785568";
        String start = str.substring(0,3);
        String end = str.substring(7);

        String result = start+"****"+end;
        System.out.println(result);
    }
}

class Id{
    public static void main(String[] args) {
        String str = "411426220410102315";

        String year = str.substring(6,10);
        String month = str.substring(10,12);
        String day = str.substring(12,14);

        String s = str.substring(16,17);

        String gender;
        char c = s.charAt(0);

        // 获取数字
        int num = c-48;

        if(c == '1'||c=='3'||c=='5'||c == '7'||c=='9'){
            gender = "男" ;
        }else{
            gender = "女" ;
        }
        System.out.println("任务信息为:");
        System.out.println("出生年月日:"+year+"年"+month+"月"+day+"日");
        System.out.println("性别为:"+gender);

    }
}

class replace{
    public static void main(String[] args) {
        // 替换敏感词
        String str = "你在狗叫什么,tmd";
        str = str.replace("tmd","***");

        System.out.println(str);
    }
}